﻿using System;
using Preactor.ObjectModel.Entities;

namespace Preactor.ObjectModel.Attributes
{
    [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
    public class PreactorFieldAttribute : Attribute
    {
        public PreactorFieldAttribute(string preactorField, FieldDeclarationType fieldDeclarationType)
        {
            bool isRefreshable = true;
            PreactorField = preactorField;
            FieldDeclarationType = fieldDeclarationType;
            IsRefreshable = isRefreshable;
        }

        public PreactorFieldAttribute(string preactorField, FieldDeclarationType fieldDeclarationType, bool isRefreshable)
        {
            PreactorField = preactorField;
            FieldDeclarationType = fieldDeclarationType;
            IsRefreshable = isRefreshable;
        }

        public bool IsRefreshable { get; private set; }

        public string PreactorField { get; private set; }

        public FieldDeclarationType FieldDeclarationType { get; private set; }
    }
}